<?php
class DAO extends CI_Controller {
	
	
	public static function getAll($className,$condition=''){
		$CI = get_instance();
		
		if($condition!='')
			$condition=" WHERE ".$condition;
		$sql=$CI->doctrine->em->createQuery("SELECT c FROM ".$className." c".$condition);
		$result=$sql->getResult();
	
		return $result;
	}
}